onmessage = function(e) {
    console.info(e.data)
}

var count = 0;

setInterval(() => {
    self.postMessage(count++)
}, 1000)